//package com.zzyl.intercept;
//
//import com.zzyl.constant.Constants;
//import com.zzyl.properties.JwtTokenManagerProperties;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//import org.springframework.web.servlet.HandlerInterceptor;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//@Component
//@Slf4j
//public class UserInterceptor implements HandlerInterceptor {
//    @Autowired
//    private JwtTokenManagerProperties jwtTokenManagerProperties;
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//       //如果不是映射到方法就方形，比如跨域验证请求，静态资源等不需要身份验证请求
//        if (!(handler instanceof HandlerInterceptor)){
//            return true;
//        }
//        //获取header的参数
//        String token = request.getHeader(Constants.USER_TOKEN);
//        return true;
//    }
//
//    @Override
//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
//        HandlerInterceptor.super.afterCompletion(request, response, handler, ex);
//    }
//}
